//
//  MUIViewController.m
//  MapleUI
//
//  Created by itzhaolei on 07/25/2019.
//  Copyright (c) 2019 itzhaolei. All rights reserved.
//

#import "MUIViewController.h"
#import "MUIHeader.h"

@interface MUIViewController ()

///滑动视图
@property (nonatomic,weak) MUIBasicScrollView *scrollView;

@end

@implementation MUIViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.scrollView contentView];
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 100.0, 100.0)];
    [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}

#pragma mark - Lazy
- (MUIBasicScrollView *)scrollView {
    if (!_scrollView) {
        MUIBasicScrollView *scrollView = [[MUIBasicScrollView alloc] initWithFrame:self.view.bounds];
        scrollView.backgroundColor = [UIColor colorWithRed:arc4random()%255 / 255.0 green:arc4random()%255 / 255.0 blue:arc4random()%255 / 255.0 alpha:1.0];
        [self.view addSubview:scrollView];
        _scrollView = scrollView;
    }
    return _scrollView;
}

- (void)click {
    self.scrollView.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width * 2, UIScreen.mainScreen.bounds.size.height * 2);
}

@end
